{extend name="property/public/insidePageBase" /}
{block name="title"}编辑费用类别{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form layui-form-pane">
            <div class="layui-row">
                <div class="layui-col-xs6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">上级分类</label>
                        <div class="layui-input-block">
                            <select name="pid"  lay-search>
                                <option value="">--顶级分类--</option>
                                {foreach $topCateData as $k=>$v}
                                <option value="{$v['id']}"  {if ($info['pid'] == $v['id'])}selected{/if}>{$v['cate_name']}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <div class="layui-form-item">
                        <label class="layui-form-label">分类名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="cate_name" value="{$info['cate_name']}" placeholder="请输入分类名称" class="layui-input" lay-verify="required" autocomplete="off"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">分类图标</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <input type="text" name="picture" value="{$info['picture']}"  placeholder="请上传分类图标" id="picture" class="layui-input">
                </div>
                <img src="{$info['picture']??''}" class="checkPictureByImg picture" style="width: 80px;height: 40px;">
                <div class="layui-input-inline layui-btn-container" style="width: auto;">
                    <button type="button" class="layui-btn layui-btn-primary uploadImg" lay-data="{field: 'picture',data:{dir:'asset/cate', field:'picture'}}">
                        <i class="layui-icon">&#xe67c;</i>
                    </button>
                </div>
            </div>
            <div class="layui-form-item" pane="">
                <label class="layui-form-label">是否显示</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_show" autocomplete="off" value="1" title="开启" {if $info['is_show'] == 1}checked{/if}>
                    <input type="radio" name="is_show" autocomplete="off" value="2" title="隐藏" {if $info['is_show'] == 2}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item layui-hide">
                <button class="layui-btn" lay-submit lay-filter="submitBtn" id="submitBtn">提交</button>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
{__block__}
<script>
    layui.use([ 'form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$ = layui.$;
        $('.uploadImg').selectImages({
            confirm:function(res,elem,data) {
                $('#' + data.field).val(res[0].src);
                $('.' + data.field).attr('src',res[0].src)
            }
        });
    });
</script>
{/block}